package us.icitap.commandcenter.ui.dispatcher;

import java.util.List;

import us.icitap.commandcenter.business.ejb.persistence.Call;
import us.icitap.commandcenter.ui.custom.CustColumnGenerator;
import us.icitap.commandcenter.ui.custom.CustTable;
import us.icitap.commandcenter.ui.shared.CallTable;

import com.vaadin.data.util.BeanItemContainer;

public class ClosedVerificationTable extends CallTable{


	
			
	public ClosedVerificationTable(boolean oneDispatcher) {
	
		super("Totali i telefonatave me status TE VERIFIKUARA: ");
		
		this.addGeneratedColumn("relatedCallNr", CustColumnGenerator.relatedCallNumberColumnGenerator);
		
		if(!oneDispatcher){
			this.setVisibleColumns(new Object[]{"relatedCallNr","caller", "callReason", "address", "description","mainDispatcher", "verifiedCallReason", "verificationNotes", "uniqueNumber","recordDate","verificationUser", "verificationDate", "startedVerificationUser"});
			this.setColumnHeaders(new String[]{"NR I TEL","TELEFONUESI", "ARSYEJA E TELEFONATES", "ADRESA", "PERSHKRIMI","Z. MBULIMIT", "REZULTATI I VERIFIKIMIT", "SHENIME", "NR. UNIK", "DT. REGJ.","MBYLLJA NGA","DT. VERIF.",  "NISJA E VER.NGA"});
			this.addGeneratedColumn("mainDispatcher", CustColumnGenerator.dispatcherColumnGenerator);
		}
		else{
			this.setVisibleColumns(new Object[]{"relatedCallNr","caller", "callReason", "address", "description", "verifiedCallReason", "verificationNotes", "uniqueNumber","recordDate", "verificationUser", "verificationDate", "startedVerificationUser"});
			this.setColumnHeaders(new String[]{"NR I TEL","TELEFONUESI", "ARSYEJA E TELEFONATES", "ADRESA", "PERSHKRIMI", "REZULTATI I VERIFIKIMIT", "SHENIME", "NR. UNIK", "DT. REGJ.", "MBYLLJA NGA","DT. VERIF.",  "NISJA E VER.NGA"});
		}
		
		this.addGeneratedColumn("caller", CustColumnGenerator.callerColumnGenerator);
		this.addGeneratedColumn("callReason", CustColumnGenerator.callReasonColumnGenerator);
		this.addGeneratedColumn("verifiedCallReason", CustColumnGenerator.callReasonColumnGenerator);
		this.addGeneratedColumn("verificationNotes", CustColumnGenerator.htmlColumnGenerator);
		this.addGeneratedColumn("uniqueNumber", CustColumnGenerator.uniqueNumberColumnGenerator);
		
		
		this.setSelectable(true);  
		this.setColumnCollapsingAllowed(true);
		
		this.setColumnCollapsed("recordDate", true);
		this.setColumnCollapsed("callReason", true);
		
		this.setPageLength(10);
		this.setWidth("980px");
		this.setColumnWidth("relatedCallNr", 30);
		this.setColumnWidth("caller", 100);
		this.setColumnWidth("callReason", 100);
		this.setColumnWidth("address", 200);
		this.setColumnWidth("description", 200);
	
		this.updateTable();

		this.addStyleName("green");
	}
	
	

	
	
}
